package practice04;

import java.util.Scanner;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice04
 * @ClassName: TestCalculator
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/1 15:30
 * @Copyright 大牛版板所有
 */
public class TestCalculator {
    public static void main(String[] args) {
        Calculator calculation = new Calculator();
        Scanner input = new Scanner(System.in);
        System.out.print("请输入第一个数字：");
        calculation.firstNum = input.nextDouble();
        System.out.print("请输入第二个数字：");
        calculation.secondNum = input.nextDouble();

        double add = calculation.add();
        System.out.println(add);
        double sub = calculation.sub();
        System.out.println(sub);
        double mul = calculation.mul();
        System.out.println(mul);
        double div = 0;
        if (calculation.secondNum != 0){
            div = calculation.div();
        }
        System.out.println(div);
    }
}
